home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7792 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: news.rain.org!usenet
  2. From: "Guus Leeuw jr." <guusl@eiffel.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Please Please Help! - pointer notation
  5. Date: Wed, 28 Feb 1996 15:30:26 -0800
  6. Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
  7. Message-ID: <3134E592.405239E2@eiffel.com>
  8. NNTP-Posting-Host: @outback.eiffel.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.8 i586)
  13. CC: scs@eskimo.com
  14.  
  15. Steve Summut once wrote:
  16. >
  17. [snip snip]
  18. > > (I'd rather write it like `char* bar()', but that's just my $0.02)
  19. >
  20. > Let me ask you one question, if I may.  We can, if we want,
  21. > declare two variables in one declaration:
  22. >
  23. >   int i, j;
  24. >
  25. > How would you prefer to write a single declaration of two pointer
  26. > variables, or two functions returning pointers?  (I'm not trying
  27. > to give you a hard time; I'm just curious.)
  28.  
  29. Okay: My $0.02 ;-)
  30.  
  31. One declaration of two pointer variables would go like:
  32. `int *a, *b;'.
  33. One declarations of two functions returning pointers would not be
  34. written. It would be two declarations.
  35.  
  36. I think it is rather confusing to write `char *foo(), *bar();'. Aand of
  37. course you can go crazy and have 80 functions in one declaration...
  38. It'll make a mess, I think.
  39.  
  40. It won't make a mess, though, when you have: `int *i1, ..., *i80;'.
  41.  
  42. Well, to make a longer story shorter, I just don't like the `*name'
  43. notation for functions. Besides that, at the company where I work,
  44. nobody uses the *name notation for functions but still for variables. So
  45. for that environment, I'm just fine.
  46.  
  47. If, with another project, someone would favor the notation I don't
  48. really like but kinda have to follow, I would do it, because it's
  49. consistent.
  50.  
  51. Basically I don't really care what notation somebody uses, but when he
  52. goes from
  53. `int* i;' to 'int *j;' I would tell him to make up his mind.
  54.  
  55. Regards,
  56.     Guus
  57.